const puppeteer = require("puppeteer");

async function detail(url) {
    const browser = await puppeteer.launch(

    );
    const page = await browser.newPage();
    await page.goto(url, {
        waitUntil: 'networkidle2'
    })
    await page.waitFor(1000)
    await page.hover("body")
    let res = await page.evaluate(() => {
        var $ = window.jQuery;
        var items = $(".atlas-mode .atlas-wrap .atlas-item");
        var links = [];
        if (items.length > 0) {
            items.each((index, item) => {
                var img = $(item).find('img').attr("src");
                links.push({
                    img,
                })
            })
        }
        return links
    })
    browser.close();
    return res;
}
module.exports = detail;